package com.qc.entity;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.qc.common.DateUtil;

public class OrderCommentEntity extends BaseEntity {

	protected long ocId;
	protected long senderUserId;
	protected long receiveUserId;
	protected long orderId;
	protected int grade;
	protected String tag;
	protected String ocContent;
	protected String createdTime;
	
	protected String avatar;//用户头像
	protected String nickname;//用户昵称
	
	public static OrderCommentEntity getInstance(ResultSet rs) throws SQLException {
		OrderCommentEntity entity = new OrderCommentEntity();

		entity.setOcId(rs.getLong("oc_id"));
		entity.setSenderUserId(rs.getLong("sender_user_id"));
		entity.setReceiveUserId(rs.getLong("receive_user_id"));
		entity.setOrderId(rs.getLong("order_id"));
		entity.setGrade(rs.getInt("grade"));
		entity.setTag(rs.getString("tag"));
		entity.setOcContent(rs.getString("oc_content"));
		
		entity.setCreatedTime(DateUtil.timestampParseString(rs.getTimestamp("created_time")));
		entity.setAvatar(rs.getString("avatar"));
		entity.setNickname(rs.getString("nickname"));

		return entity;
	}
	
	public String getTag() {
		return tag;
	}
	public void setTag(String tag) {
		this.tag = tag;
	}
	public long getOcId() {
		return ocId;
	}
	public void setOcId(long ocId) {
		this.ocId = ocId;
	}
	public long getSenderUserId() {
		return senderUserId;
	}
	public void setSenderUserId(long senderUserId) {
		this.senderUserId = senderUserId;
	}
	public long getReceiveUserId() {
		return receiveUserId;
	}
	public void setReceiveUserId(long receiveUserId) {
		this.receiveUserId = receiveUserId;
	}
	public long getOrderId() {
		return orderId;
	}
	public void setOrderId(long orderId) {
		this.orderId = orderId;
	}
	public int getGrade() {
		return grade;
	}
	public void setGrade(int grade) {
		this.grade = grade;
	}
	public String getOcContent() {
		return ocContent;
	}
	public void setOcContent(String ocContent) {
		this.ocContent = ocContent;
	}

	public String getCreatedTime() {
		return createdTime;
	}

	public void setCreatedTime(String createdTime) {
		this.createdTime = createdTime;
	}

	public String getAvatar() {
		return avatar;
	}

	public void setAvatar(String avatar) {
		this.avatar = avatar;
	}

	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}
	
	
}
